from django.db import models
from myutils.base_model import BaseModel
# Create your models here.

class Role(models.Model):
    name = models.CharField(max_length=32)
    class Meta:
        db_table = 'role'

    def __str__(self):
        return self.name

class User(models.Model):
    username = models.CharField(max_length=30)
    password = models.CharField(max_length=256)
    phone = models.CharField(max_length=11, null=True,blank=True)
    email = models.CharField(max_length=30, null=True,blank=True)
    staute = models.BooleanField(default=False)
    role = models.ForeignKey(Role, on_delete=models.CASCADE)

    class Meta:
        db_table = 'user'

    def __str__(self):
        return self.username








